package Interfaces;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class InterfaceFundo extends JPanel {
	private BufferedImage image;

	public InterfaceFundo() {

		try {
			image = ImageIO.read(new File("Images/imagem_fundo.jpg"));
		} catch (IOException ex) {
			// handle exception...
			System.err.println("tratar excepcao");
		}
	}

	public void paintComponent(Graphics g) {
		int x = (getWidth() - image.getWidth()) / 2;
		int y = (getHeight() - image.getHeight()) / 2;
		g.drawImage(image, x, y, null);

	}

}